<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
    'language' => 'zh-CN',
    'modules' => [
        'wechat' => [
            'class' => 'frontend\modules\wechat\Module',
        ],
        'screen' => [
            'class' => 'frontend\modules\screen\Module',
            'defaultRoute' => 'site',
        ],
        'business' => [
            'class' => 'frontend\modules\business\Module',
            'defaultRoute' => 'site',
            'layout' => '/mobile',
        ],
        'shop' => [
            'class' => 'frontend\modules\shop\Module',
            'defaultRoute' => 'site',
            'layout' => '/mobile',
        ],
        'farmerhouse' => [
            'class' => 'frontend\modules\farmerhouse\Module',
            'defaultRoute' => 'site',
            'layout' => '/mobile',
        ],
        'pay' => [
            'class' => 'frontend\modules\pay\Module',
            'defaultRoute' => 'site',
            'layout' => '/mobile',
        ],
        'articlesite' => [
            'class' => 'frontend\modules\articlesite\Module',
            'defaultRoute' => 'site',
            'layout' => '/mobile',
        ],
    ],
    'components' => [
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['info','error'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'view' => [
            'renderers' => [
                'html' => [
                    'class' => 'yii\smarty\ViewRenderer',
                    'cachePath' => '@runtime/Smarty/cache',
                    'compilePath' => '@runtime/Smarty/compile',
                    'options' => [
                        'left_delimiter' => '<{',
                        'right_delimiter' => '}>',
                    ],
                ],
            ],
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                //''
            ],
        ],
//        'session' => [
//            'class' => 'yii\redis\Session',
//            'redis' => [
//                'hostname' => '127.0.0.1',
//                'port' => 6379,
//                'password' => 'rds423fsadD',
//                'database' => 0,
//            ],
//        ],

    ],
    'params' => $params,
];
